﻿using System;
using System.Linq;

namespace LINQPad
{
    public static class AutoUpdateDisabler
    {
        public static string[] AddNoUpdate(string[] args)
        {
            bool flag = args.Any((string arg) => string.Equals(arg, AutoUpdateDisabler.NoupdateKey, StringComparison.OrdinalIgnoreCase));
            string[] result;
            if (flag)
            {
                result = args;
            }
            else
            {
                string[] array = new string[args.Length + 1];
                Array.Copy(args, array, args.Length);
                array[args.Length] = AutoUpdateDisabler.NoupdateKey;
                result = array;
            }
            return result;
        }

        public static string NoupdateKey = "-noupdate";
    }
}